import React from 'react'
import { withRouter } from 'react-router-dom'
import { connect } from 'react-redux'
import { getMsg } from '../../redux/actionCreator'
import pxPage from '../../root/pxPage'

const touxianggexing = {
    width: '100%',
    height: pxPage(140),
    borderBottom: '1.5px solid #fff'
}

const tuxianghello = {
    // width: pxPage(160),
    height: pxPage(20),
    position: 'absolute',
    top: pxPage(33),
    left: pxPage(86),

}

const touxiangimg = {
    width: pxPage(45),
    height: pxPage(45),
    position: 'absolute',
    top: pxPage(30),
    left: pxPage(0),
    borderRadius: '50%',
    border: '1px solid #fff',
    objectFit: 'cover'
}
const commtext = {
    position: 'absolute',
    top: pxPage(105),
    left: pxPage(35),
    fontSize: pxPage(12),
    // borderTop:'1px solid'
}
class Touxiang extends React.Component {
    constructor(props) {
        super(props);
        this.state = {};
    }
    render() {
        const { pathname } = this.props.location;
        return (
            <div className='touxiang' style={touxianggexing}>
                <div style={{border:'1px solid #6E6E6E',width:'100%',height:'90px'}}>

                    <div
                        style={{ position: 'absolute', left: '5%' }}
                        onClick={() => {
                            this.props.history.push('/busme')
                        }}
                    >
                        {/* 头像 */}
                        <img style={touxiangimg} src={`http://www.h5weixin.club:1025/api/image/${getMsg(this.props).business_pic}`}></img>
                    </div>
                    <span style={tuxianghello}>{getMsg(this.props).business_name}</span>
                </div>

                <span style={commtext}>我的评价</span>
            </div>
        )
    }
}

const mapStateToProps = (state) => ({
    login: state.login
})

export default withRouter(connect(mapStateToProps)(Touxiang))
